-- 实收付基础数据 WMS.CF37 
insert into comstp_schedule_config
	 SELECT SEQ_COMSTP_SCHEDULE_CONFIG.nextval, a.* from 
	 	(   
 			select cus_number,'WMS', null, 'WMS_REAL_PR', 'Y','PAYMENT_REAL_BASE'
	            FROM comstp_schedule_config t
	            where t.task_name = 'WMS_REAL_PR'
	              and t.activate = 'Y'
	              and not exists
	                 (
	                 	SELECT * FROM comstp_schedule_config t1 where t1.cus_number = t.cus_number 
											                 	  and t1.task_name = t.task_name 
											                 	  and t1.task_node = 'PAYMENT_REAL_BASE'
	                 )
	         group by cus_number
         ) a;           
commit;   

insert into comstp_schedule_config
  SELECT SEQ_COMSTP_SCHEDULE_CONFIG.nextval, a.*
    from (select cus_number,
                 'WMS',
                 null,
                 'WMS_REAL_PR',
                 'N',
                 'PAYMENT_REAL_BASE'
            FROM comstp_schedule_config t
           where task_name = 'WMS_REAL_PR'
             and t.activate = 'N'
             and not exists
                 (SELECT *
                    FROM comstp_schedule_config t1
                   where t1.cus_number = t.cus_number
                     and t1.task_name = t.task_name
                     and t1.task_node = 'PAYMENT_REAL_BASE')
           group by cus_number) a;           
commit;    


